package com.forekonw.deomlianxi;
public class Ceyan4 {
    public static void main(String[] args) {
        int[] array =new int[7];
        array[0]=-10;
        array[1]=2;
        array[2]=3;
        array[3]=246;
        array[4]=-100;
        array[5]=0;
        array[6]=5;
        double sum = 0;
        double avg = 0;
        int nob = 0;
        int num = 0;
        nob = array[0];
        for (int i=0;i<array.length;i++){
            sum+=array[i];
            avg = sum/array.length;
            if (nob > array[i]){
                nob=array[i];
            }else if (num < array[i]){
                num = array[i];
            }
    }
        System.out.println("该数组的平均值为 " +avg);
        System.out.println("该数组的最小值为 " +nob);
        System.out.println("该数组的最大值为 "+num);
    }
}
